Within computing environments, there may be a single owner, or server, of data responsible for managing access to the data by a number of different clients. Regulating access to the data is necessary so that the data is not corrupted. For example, in the context of database systems, if two different clients desire to modify the same record of data at the same time, there is great potential for the data to be corrupted. Therefore, generally, the server provides for a locking mechanism so that the clients can have access to the data, without corrupting it.
Generally, read-only access can be provided on a non-exclusive basis by the server to the clients. That is, any number of clients can at the same time have read-only access to the data. However, read-and-write access to the data usually must be provided on an exclusive basis, such that if one of the clients is writing—for example, modifying—the data, then no other clients can simultaneously have either read-and-write access or read-only access to the data. This is necessary so that the data does not become corrupted. Within database systems, for example, such read-only and read-and-write access is typically regulated on a record-by-record basis.
The prior art generally provides for polling as a mechanism by which access is requested by clients and granted by a server. When a client desires access to the data, it polls the server. The server must then immediately grant or deny the client the desired access. If the server has denied the client access, then the client typically must enter into a loop in which it waits for a while, and then re-polls the server. Such a situation is sometimes referred to within the prior art as a spinlock. When the server finally grants the client access, the client has what is referred to as a lock on the data—for example, either a read-only lock, or a read-and-write lock. When the client does not need the granted access to the data any longer, it then calls the server to return the lock, which is also known as unlocking the access.
This locking and unlocking approach within the prior art, however, has several disadvantages. It is inefficient: clients must commonly poll the lock repeatedly in order to obtain access to the data. The prior art also approach does not provide for server-governed timing control of data access: when a client requests access to the data, the server must immediately grant or deny the request; the server does not have the option, for example, of delaying granting the request. For these and other reasons, therefore, there is a need for the present invention.